﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Project8
{
    public partial class GUI : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PosrednikServis servis = new PosrednikServis();

            string[] iminjata = servis.Banki();
            int[] iznos = servis.Iznos();
            int[] kamati = servis.Kamata();
            int[] rati = servis.BrRati();

            //ListItem li = new ListItem();
            /*
            TableRow red;
            TableCell celija;

            red = new TableRow();
            celija = new TableCell();
            celija.Text = "Ime na Banka";
            red.Cells.Add(celija);
            celija = new TableCell();
            celija.Text = "Iznos na kreditot";
            red.Cells.Add(celija);
            celija = new TableCell();
            celija.Text = "Kamatata vo %";
            red.Cells.Add(celija);
            celija = new TableCell();
            celija.Text = "Broj na Rati";
            red.Cells.Add(celija);
            red.Font.Bold = true;
            Table1.Rows.Add(red);

            for (int i = 0; i < iminjata.Length; i++)
            {
                red = new TableRow();

                celija = new TableCell();
                celija.Text = iminjata[i];
                red.Cells.Add(celija);
                celija = new TableCell();
                celija.Text = iznos[i].ToString();
                red.Cells.Add(celija);
                celija = new TableCell();
                celija.Text = kamati[i].ToString();
                red.Cells.Add(celija);
                celija = new TableCell();
                celija.Text = rati[i].ToString();
                red.Cells.Add(celija);
                Table1.Rows.Add(red);

            }
            */

            Gridview1.DataSource = servis.CelaTabela();
            Gridview1.DataBind();
           


        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("Dodaj.aspx");
        }
    }
}